import 'package:flutter/material.dart';
import 'package:get/get.dart';

import 'splash_logic.dart';

class SplashWidget extends GetView<SplashLogic> {

//全局 Key 用来获取 Form 表单组件
  GlobalKey<FormState> loginKey = GlobalKey<FormState>();
  // final logic = Get.put(SplashLogic());


  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('data'),
      ),
      body: Form(
          autovalidateMode: AutovalidateMode.onUserInteraction,
          key: loginKey,
          child: Column(
            children: [
              TextField(
                decoration: const InputDecoration(
                  labelText: '请输入用户名',
                  hintText: '用户名或邮箱',
                ),
                textInputAction: TextInputAction.next,
                keyboardType:TextInputType.phone ,
                onChanged: (value) {
                  print(value);

                },
              ),
              TextField(
                decoration: const InputDecoration(
                  labelText: '密码',
                  hintText: '密码',
                ),
                obscureText: true,
                onChanged: (value) {
                  print(value);
                },
              ),
            ],
          )),
      floatingActionButton: FloatingActionButton(
        onPressed: () {
          controller.startTime();
        },
        child: const Icon(Icons.add),
      ),
    );
  }
}
